/*
 * @Author: your name
 * @Date: 2022-03-31 15:18:08
 * @LastEditTime: 2022-03-31 19:54:03
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \lalalal\src\views\finance\myButton.jsx
 */
import React,{useState} from 'react';
import { Button } from 'antd';
import './myButton.css'
const Mybutton = (props) => {

    const { btnData, size } = props
    const [btnIndex,setbtnIndex] = useState(1)
    const bgc=(id)=>{
        setbtnIndex(id)
    }
    return (
        btnData.map(item => {
            return <Button type='primary'key={item.id} size={size} 
            onClick={()=>bgc(item.id)} style={{backgroundColor:btnIndex===item.id? "#f56659" : "#488dc9"}}
            >
                {item.title}
                <span className='pay_number'>{item.count}</span>
            </Button>
        })

    );
}

export default Mybutton;
